<template>
	<view >
		<view class="box"   v-for="item in notoceList"  @click="gopath(item)">
			<view class="" style="display: flex;flex-direction: column;justify-content: space-between;">
				<view class="" style="white-space: nowrap;
						overflow: hidden;
						text-overflow: ellipsis;font-weight: 700;">
					{{item.title}}
				</view>
				<view class="">
					{{item.createTime}}  
				</view>
			</view>
			<view class="" style="width: 230rpx;height: 120rpx;border-radius: 15rpx;">
				<image style="width: 230rpx;height: 120rpx;border-radius: 15rpx;" :src="item.activityImgUrl" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {searchPlugsNoticeList,searchPlugsNoticeById} from '../../../utils/api.js'
	export default {
		data() {
			return {
				notoceList:[]
			}
		},
		onShow() {
				this.getNotoceList()
		},
		methods: {
			getNotoceList(){
				let data={
					userServiceToken:this.userToken
				}
				searchPlugsNoticeList(data).then(res=>{
					if(res.code==200){
						res.body.list.forEach((item=>{
							if(item.showHide==0){
								this.notoceList.push(item)
							}
						}))
					}
				})
			},
			gopath(item){
				uni.navigateTo({
					url:`/pages/index/noticeList/noticeDetails?info=${encodeURIComponent(JSON.stringify(item))}`
				})
			}
		}
	}
</script>

<style  lang="scss">
page{
	background: #f5f5f5;
	padding: 20rpx;
}
.box{
	display: flex;
	justify-content: space-between;
	padding: 20rpx;font-size: 26rpx;
	border-radius: 20rpx;
	margin-bottom: 20rpx;
	background-color: #fff;
	margin-bottom: 20rpx;
	border-radius: 10rpx;
}
</style>
